package com.jiyang.jyandroid.other;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.view.View;

import com.jiyang.jyandroid.R;

/**
 * Created by jy on 2016/12/1.
 * 飞机View
 */

public class AircraftView extends View {
    private Bitmap bitmap;
    private Paint paint;
    private float _x, _y;


    public AircraftView(Context context) {
        super(context);
        bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.aircraft);
        _x = _y = 0;
        paint = new Paint();
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        canvas.drawBitmap(bitmap, _x, _y, paint);
    }

    public void set_x(float x) {
        _x = x;
    }

    public void set_y(float y) {
        _y = y;
    }
}
